﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;

namespace PaiPaiImage
{
    class FileInfoViewModel : DependencyObject
    {
        public static readonly DependencyProperty StateProperty = DependencyProperty.Register("State", typeof(string), typeof(FileInfoViewModel));
        public static readonly DependencyProperty BackgruodProperty = DependencyProperty.Register("Background", typeof(Brush), typeof(FileInfoViewModel));

        public string Path { get; private set; }

        public string PixelSize { get; private set; }

        public int Width { get; private set; }

        public long SizeInKB { get; private set; }

        public string State { get { return (string)this.GetValue(StateProperty); } set { this.SetValue(StateProperty, value); } }

        public Brush Background { get { return (Brush)this.GetValue(BackgruodProperty); } set { this.SetValue(BackgruodProperty, value); } }

        public string Action { get { return "删除"; } }

        public FileInfoViewModel(string path, string pixelSize, long sizeInKB, string state, Brush background)
        {
            this.Path = path;
            this.PixelSize = pixelSize;
            this.SizeInKB = sizeInKB;
            this.State = state;
            this.Background = background;
            this.Width = int.Parse(pixelSize.Split('X')[0].Trim());
        }
    }
}
